<div class="form">
    <?php
    $formConfig['htmlOptions']['class'] = 'form-horizontal';
    $formConfig['htmlOptions']['role'] = 'form';
    ?> 

    <?php $form = $this->beginWidget('ActiveForm', $formConfig); ?>

    <?php
    echo $form->alert(array($article, $content), array(
        'errorMessageHtmlOptions' => array('class' => 'alert alert-danger'),
        'flashHtmlOptions' => array('class' => 'alert alert-'),
    ));
    ?>    

    <?php if (!$article->isNewRecord): ?>	
        <div class="form-group">
            <?php echo $form->labelEx($article, 'id_', array('class' => 'col-sm-2 control-label')); ?>
            <div class="col-sm-2">
                <div class="form-control-static">
                    <?php echo $article->id; ?>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <div class="form-group">
        <?php echo $form->labelEx($article, 'parent_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($article, 'parent_', $article->parentOption, array('prompt' => Lang::t('article.lbl.select.root'), 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($article, 'parent_'); ?>

        <?php echo $form->labelEx($article, 'status_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($article, 'status_', $article->statusOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($article, 'status_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($article, 'type_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php
            echo $form->dropDownList($article, 'type_', $article->typeOption, array(
                'prompt' => Lang::t('article.lbl.select.type'),
                'class' => 'form-control',
                'ajax' => array(
                    'type' => 'POST',
                    'url' => Yii::app()->createUrl('ajax/articletypeurl'),
                    'success'=>'function(data){
                        $("#Article_url_").val(data);
                        console.log(data);
                    }',
                ),
            ));
            ?>
        </div>
        <?php //echo $form->error($article, 'type_'); ?>

        <!--
        <?php //echo $form->labelEx($article, 'categoryId_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php //echo $form->dropDownList($article, 'categoryId_', $article->categoryOption, array('prompt' => Lang::t('article.lbl.select.category'), 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($article, 'categoryId_'); ?>
        -->
        
        <?php echo $form->labelEx($article, 'layout_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($article, 'layout_', $article->layoutOption, array('prompt' => Lang::t('article.lbl.select.layout'), 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($article, 'layout_'); ?>
    </div>
    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($article, 'url_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textField($article, 'url_', array('class' => 'form-control')); ?>

            <div class="checkbox">
                <label>
                    <?php echo $form->checkBox($article, 'newWindow_', array('template'=>'tt')); ?>
                    <i class="fa fa-square-o small"></i>
                    <?php echo $form->labelEx($article, 'newWindow_'); ?>
                    <?php //echo $form->error($article, 'newWindow_'); ?>
                </label>
            </div>
        </div>
        <?php //echo $form->error($article, 'url_'); ?>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($content, 'title_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textField($content, 'title_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'title_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($content, 'description_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textArea($content, 'description_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'description_'); ?>
    </div>
    
    <div class="form-group">
        <?php echo $form->labelEx($content, 'content_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->editorTextArea($content, 'content_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'content_'); ?>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($content, 'sefUrl_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textField($content, 'sefUrl_', array('rows' => 6, 'cols' => 50, 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'sefUrl_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($content, 'metaTitle_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textField($content, 'metaTitle_', array('rows' => 6, 'cols' => 50, 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'metaTitle_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($content, 'metaDescription_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textArea($content, 'metaDescription_', array('rows' => 6, 'cols' => 50, 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'metaDescription_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($content, 'metaKeywords_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textField($content, 'metaKeywords_', array('rows' => 6, 'cols' => 50, 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($content, 'metaKeywords_'); ?>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($article, 'image_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->multiImageUpload($article, 'image_'); ?>
        </div>
        <?php //echo $form->error($article, 'image_'); ?>
    </div>

    <div class="form-group">
        <?php
        $form->galleryEditor($article, 'imageEditor_', array(
            'imageTemplate'=>'<div>{image}</div><div>{id}, {captionInput} {control}<br />{fileName}<br />{type}, {size}, {totalView}</div>',
            'captionOptions'=>array('maxLength'=>100),
            'class'=>'image-editor',
        ));
        ?>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($article, 'buttonCssClass_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php echo $form->textField($article, 'buttonCssClass_', array('rows' => 6, 'cols' => 50, 'class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($article, 'buttonCssClass_'); ?>
    </div>
    
    <div class="form-group">
        <?php echo $form->labelEx($article, 'userAccess_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php
            echo $form->checkBoxList($article, 'userAccess_', $article->userRoleOption, array(
                'labelOptions' => array('class' => 'checkbox-inline'),
                'template' => '{beginLabel}{input} <i class="fa fa-square-o small"></i>{labelTitle}{endLabel}',
                'separator' => '<br />',
                'checkAll' => 'Select All',
            ));
            ?>
        </div>
        <?php //echo $form->error($article, 'userAccess_');  ?>
    </div>

    <div class="form-group">    
        <?php echo $form->labelEx($article, 'section_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
            <?php
            echo $form->checkBoxList($article, 'section_', $article->sectionOption, array(
                'labelOptions' => array('class' => 'checkbox-inline'),
                'template' => '{beginLabel}{input} <i class="fa fa-square-o small"></i>{labelTitle}{endLabel}',
                'separator' => '<br />',
                'checkAll' => 'Select All',
            ));
            ?>
        </div>
        <?php //echo $form->error($article, 'section_');  ?>
    </div>    

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-6">
            <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-floppy-save"></span> <?php echo $article->isNewRecord ? Lang::t('article.create.btn.submit') : Lang::t('article.update.btn.submit'); ?></button>
            <a href="<?php echo $this->homeUrl; ?>" class="btn btn-default"><span class="glyphicon glyphicon-floppy-remove"></span> <?php echo Lang::t('article.create.btn.cancel'); ?></a>
        </div>
    </div>

    <?php $this->endWidget(); ?>

</div><!-- form -->